#ifndef QFORMLISTWIDGET_H
#define QFORMLISTWIDGET_H

#include <QWidget>
#include <QMap>
#include <QList>

class   WidgetHost;
class   QPropertyListView;
class   AbstractCore;
class   QFormWidget;

class QFormListWidget : public QWidget
{
    Q_OBJECT
public:
    explicit QFormListWidget(AbstractCore *core,QPropertyListView *listView,QWidget *parent = 0);

    void    showForm(const QString &name);

    bool    dirty(int index);

    QFormWidget *currentForm();
signals:

public slots:
    void    alignLeft();
    void    alignRight();
    void    alignTop();
    void    alignBottom();
    void    alignVCenter();
    void    alignHCenter();
protected:
    void    addForm(const QString &name,const QString &data,int index=-1);
protected slots:
    void    projectOpen();
    void    projectClosed();
    void    projectSave();
    void    changed();

    void    projectChanged(int type,int index);
signals:
    void    updateFormName(int index);
protected:
    QList<WidgetHost*>         m_formlist;
    QMap<QString,WidgetHost*>  m_nameToForm;
    QPropertyListView          *m_listview;
    QString                    m_current;
    AbstractCore               *m_core;
};

#endif // QFORMLISTWIDGET_H
